package org.example.gradleDemo.jmh;

import java.util.*;

public class TreeMapJmh {
    TreeMap<Long, Trade> _map = new TreeMap<>();

    public final void put(final Trade trade) {
        _map.put(trade.id(), trade);
    }

    public final Trade GetSecondPrice() {
       var entity=  _map.entrySet()
                .stream()
                .skip(1)
                .map(Map.Entry::getValue)
                .findFirst();
        return entity.orElse(null);
    }
}
